package ar.com.personalTravellers.beans;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;

import com.angel.architecture.persistence.base.PersistentObject;
import com.angel.common.interfaces.Activable;

@Entity
public class Neighborhood extends PersistentObject implements Activable{

    @Column(nullable = false)
    private String name;

    private Boolean active;

    @Enumerated(value = EnumType.STRING)
    @Column(nullable = false)
    private Zone zone;

    public Neighborhood() {
        super();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Zone getZone() {
        return zone;
    }

    public void setZone(Zone zone) {
        this.zone = zone;
    }

    @Override
    public String toString(){
        return this.getName() + " [ Zone: " + this.getZone().getZone() + "].";
    }

    public Boolean isActive() {
        return this.active;
    }

    public void setActive(Boolean active) {
        this.active = active;
    }

    public void active() {
        this.setActive(true);
    }

	public void unActivate() {
		this.setActive(false);
	}
}